package cn.itheima.service.takedelivery.impl;

import cn.itheima.dao.WayBillRepository;
import cn.itheima.domain.take_delivery.WayBill;
import cn.itheima.service.takedelivery.WayBillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

/**
 * Created by millions on 2017/7/10.
 */
@Service
public class WayBillServiceImpl implements WayBillService {

    @Autowired
    private WayBillRepository wayBillRepository;

    @Override
    public Page<WayBill> pageQuery(Pageable pageable) {
        return wayBillRepository.findAll(pageable);
    }

    @Override
    public void save(WayBill model) {
        wayBillRepository.save(model);
    }

    @Override
    public WayBill findByWayBillNum(String wayBillNum) {
        return wayBillRepository.findByWayBillNum(wayBillNum);
    }
}
